package BehavioralMode.memento.blackBox.gameFile;

/**
 *  备忘录黑盒模式
 * */
public class Client {
    public static void main(String[] args) {

        Originator originator = new Originator();
        originator.initStatus();
        originator.showStatus();


        originator.attackBoss();
        originator.showStatus();

        System.out.println("保存存档");

        Caretaker caretaker = new Caretaker();
        caretaker.saveStatus("第一次攻击存档",originator.createMemnto());
        System.out.println(caretaker.toString());

        originator.attackBoss();
        originator.attackBoss();
        originator.showStatus();

        originator.restore(caretaker.getStatus("第一次攻击存档"));
        originator.showStatus();
    }
}
